Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor a bit #23

Merged
merged 28 commits into from
Dec 13, 2024
Merged

Refactor a bit #23

merged 28 commits into from
Dec 13, 2024

Conversation

pavelzw
Copy link
Member

@pavelzw pavelzw commented Dec 4, 2024

Motivation

This makes the code a bit easier to follow.

Changes

Introduce a CondaDenyConfig struct that contains all configuration and is generated at the beginning from CLI + config.toml.
We can then pass this struct to all methods that need it instead of needing to handle config parsing and evaluating everywhere.

With this, there are three config structs: the toml, the cli as well as the final config that is used in the business logic. The toml and cli configs are used at the beginning exclusively to generate the main config struct.

@pavelzw pavelzw marked this pull request as ready for review December 11, 2024 11:04
src/cli.rs Outdated Show resolved Hide resolved
src/cli.rs Outdated Show resolved Hide resolved
src/cli.rs Show resolved Hide resolved
src/cli.rs Show resolved Hide resolved
src/conda_deny_config.rs Show resolved Hide resolved
@pavelzw pavelzw merged commit 2460124 into main Dec 13, 2024
14 checks passed
@pavelzw pavelzw deleted the refactor branch December 13, 2024 14:04
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 88.85135% with 33 lines in your changes missing coverage. Please review.

Project coverage is 84.05%. Comparing base (b0154b1) to head (dfc7eea).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/license_whitelist.rs 87.50% 8 Missing ⚠️
src/check.rs 81.08% 7 Missing ⚠️
src/main.rs 0.00% 7 Missing ⚠️
src/lib.rs 93.75% 6 Missing ⚠️
src/pixi_lock.rs 85.71% 2 Missing ⚠️
src/conda_deny_config.rs 94.11% 1 Missing ⚠️
src/license_info.rs 96.96% 1 Missing ⚠️
src/list.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #23       +/-   ##
===========================================
+ Coverage   56.42%   84.05%   +27.63%     
===========================================
  Files          11       12        +1     
  Lines         514      508        -6     
===========================================
+ Hits          290      427      +137     
+ Misses        224       81      -143     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants